package com.j1ay.forum.controller;

import com.j1ay.forum.service.LoginService;
import com.j1ay.forum.model.pojo.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author J1ay
 * @Date 2021/12/16 22:15
 * @Description 退出登录
 */

@RestController
@RequestMapping("api")
@Api(value="Logout Controller",tags={"登出接口"})
public class LogoutController {

    @Autowired
    private LoginService loginService;

    @ApiOperation(value = "用户登出")
    @GetMapping("/user/logout")
    public Result logout(@RequestHeader("Authorization") String token) {
        return loginService.logout(token);
    }
}
